package com.qumitech.visualnovel.controller.rest;

import com.qumitech.visualnovel.model.common.BaseRsp;
import com.qumitech.visualnovel.service.gaming.GamingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/gaming")
public class GamingController {
    @Autowired
    private GamingService gamingService;

    @GetMapping("/{gaming_type}/publicpool")
    public BaseRsp getPublicPool(@PathVariable("gaming_type") String gamingType){
        return gamingService.getPublicPool(gamingType);
    }

    @PutMapping("/{gaming_type}/publicpool/{public_pool}")
    public BaseRsp replacePublicPool(@PathVariable("gaming_type") String gamingType,
                                     @PathVariable(name = "public_pool") double publicPool){
        return gamingService.replacePublicPool(gamingType, publicPool);
    }
}
